<template>
  <div>
    <h2>分类列表</h2>
    <div class="List">
      <Child v-for="item in itemData" :key="item.id" v-bind="item">
        <template v-slot:default="{ content }">
          <ul>
            <li v-for="item in content" :key="item">{{ item }}</li>
          </ul>
        </template>
      </Child>
    </div>
  </div>
</template>

<script>
import Child from "@/components/Child";
export default {
  name: "App",
  components: { Child },
  data() {
    return {
      itemData: [
        {
          id: "001",
          content: ["火锅", "烧烤", "螺蛳粉"],
          title: "美食",
        },
        {
          id: "002",
          content: ["等你下课", "我的天空", "海阔天空"],
          title: "音乐",
        },
        {
          id: "003",
          content: ["CF", "DNF", "CS"],
          title: "游戏",
        },
      ],
    };
  },
};
</script>

<style>
.List {
  display: flex;
  justify-content: space-around;
}
</style>
